<template>
  <div>
    <el-input v-model="name" placeholder="测试worker"></el-input>
    <div>{{ content }}</div>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const name = ref('')
const worker = new Worker(new URL('./calc.work.ts', import.meta.url))
worker.postMessage([1000000000, 2000000000])
worker.onmessage = function (e) {
  console.log(e.data.time)
  console.log(e.data.content)
  handleData(e.data.content)
}
const content = ref('hello world')
const handleData = (res: any) => {
  content.value = res
}
</script>
<style lang="scss" scoped></style>
